package com.quanyan.pay.mapper;

import com.quanyan.orderpay.response.RespOrderInfo;
import com.quanyan.pay.entity.PayRecord;
import com.quanyan.pay.entity.PayRecordDetail;
import com.quanyan.pay.entity.RefundCompleteData;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author songzj
 * @date 16/6/24-21:02
 */
public interface UPayRecordMapper {




    /**
     * 申请退款
     *
     * @param orderNo
     * @param refundAmount
     * @return
     */
    int updatePayRecordRefundApply(@Param("orderNo") String orderNo, @Param("refundAmount") BigDecimal refundAmount);


    /**
     *
     * @param orderNo
     * @param payId
     * @param refundAmount
     * @return
     */
    int updatePayRecordDetailRefundApply(@Param("orderNo")String orderNo, @Param("payId")Integer payId, @Param("refundAmount")BigDecimal refundAmount);


    /**
     * 订单退款成功处理
     *
     * @param orderNo
     * @param refundAmount
     * @return
     */
    int updatePayRecordRefundSuccess(@Param("orderNo") String orderNo, @Param("refundAmount") BigDecimal refundAmount);

    /**
     *
     * @param orderNo
     * @param payId
     * @param refundAmount
     * @return
     */
    int updatePayRecordDetailRefundSuccess(@Param("orderNo")String orderNo, @Param("payId")Integer payId, @Param("refundAmount")BigDecimal refundAmount);

    int updatePayRecordRefundComplete(RefundCompleteData refundCompleteData);

    List<RespOrderInfo> orderQueryBacth(List<String> list);

    List<PayRecordDetail> findByOrderNo(List<String> orderNoList);

    List<PayRecord> scanPayRepair();

    void updateScanPayRecord(PayRecord updatePayRecord);
}
